<!--

  $Id: all.html,v 1.11 2006/05/25 10:47:00 justb Exp $
  author: Just van den Broecke

-->
<html>
   <title>All Event</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <meta http-equiv="Pragma" content="no-cache">

   <script type="text/javascript" src="../dojo1.7/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
   <script type="text/javascript" src="../js/js-pushlet-client.js"></script>
   
     <script type="text/javascript">
        var mongoStat;
        var mongoStatObj;
       	// Initialization
		function pushlet_init() {
			p_join_listen('/cloud/mongodb');
  		}

		// Event Callback: display all events
		function onEvent(event) {
			mongoStat=event.get("mongo_stat");
			document.eventDisplay.event.innerHTML=mongoStat;
			mongoStatObj=dojo.fromJson(mongoStat);
			//console.log(mongoStatObj);
			dojo.byId('db').innerHTML=mongoStatObj.db;
			dojo.byId('collections').innerHTML=mongoStatObj.collections;
			dojo.byId('objects').innerHTML=mongoStatObj.objects;
			dojo.byId('avgObjSize').innerHTML=mongoStatObj.avgObjSize;
			dojo.byId('dataSize').innerHTML=mongoStatObj.dataSize;
			dojo.byId('storageSize').innerHTML=mongoStatObj.storageSize;
			dojo.byId('fileSize').innerHTML=mongoStatObj.fileSize;
		}
	</script>
<body bgcolor="#cccccc" onLoad="pushlet_init()">

<script type="text/javascript">p_embed()</script>

<h4>Event Monitor</h4>

<form name="eventDisplay">
  <table border="2" bordercolor="white" cellpadding="4" cellspacing="0" >
    <tr>
     <td>
       <textarea cols="40" rows="16" name="event">
       </textarea>
       <table>
        <tr>
          <td>数据库:</td>
          <td id="db">db</td>
        </tr>
        <tr>
          <td>集合总数:</td>
          <td id="collections">collections</td>
        </tr>
        <tr>
          <td>对象总数:</td>
          <td id="objects">objects</td>
        </tr>
        <tr>
          <td>平均对象大小:</td>
          <td id="avgObjSize">avgObjSize</td>
        </tr>
        <tr>
          <td>数据总量:</td>
          <td id="dataSize">dataSize</td>
        </tr>
        <tr>
          <td>空间总量:</td>
          <td id="storageSize">storageSize</td>
        </tr>
        <tr>
          <td>数据文件总大小:</td>
          <td id="fileSize">fileSize</td>
        </tr>
       </table>
     </td>
    </tr>
  </table>
</form>

</body>
</html>

